import tensorflow as tf

import numpy as np

# 声明一个变量，并转换类型
var1 = tf.constant(1)
var2 = tf.cast(tf.constant(8.2), dtype=tf.int32)

var3 = tf.Variable(45)
var4 = tf.cast(tf.Variable(2.545), dtype=tf.int32)

# 生产一个数组
print(np.random.random(1)[0])
print(np.random.rand(100).astype(np.float32))

init_op = tf.global_variables_initializer()

result1 = tf.divide(var1, var2)
result2 = tf.add(var3, var4)

with tf.Session() as session:
    session.run(init_op)
    print(session.run([result1, result2]))
